package org.aurora.framework.boot.common.rpc.response;

import java.io.Serial;

/**
 * DataResponse
 * <pre>
 * description:
 * create date: 2025-03-23 14:23:46
 * </pre>
 *
 * @author cao.yong
 */
public class DataResponse<T> extends BaseResponse {
    @Serial
    private static final long serialVersionUID = 1L;

    private final T data;

    public DataResponse() {
        this(null);
    }

    public DataResponse(T data) {
        this(true, ResponseCode.SUCCESS.getValue(), ResponseCode.SUCCESS.name(), data);
    }

    public DataResponse(boolean isSuccess, int code, String message, T data) {
        super(isSuccess, code, message);
        this.data = data;
    }

    public T getData() {
        return data;
    }
}
